home *** CD-ROM | disk | FTP | other *** search
/ Windows News 2010 Summer - Disc 1 / WN_Ete2010_CD1.iso / Onglet5 / Weezo / Weezo setup.exe / {code_appDir} / www / js / mainFrame.js < prev    next >
Text File  |  2010-05-19  |  5KB  |  1 lines

  1. function bgConfigLink(){openResource("/res/administration/config/main.php","-1",winCaptionConfig,winIconConfig,{dWW:340,dWH:200})}function bgHTMLLoaded(){if(W.backgroundOnload){W.backgroundOnload()}iconRestorePosition();iconAnimate();bgSetWindows()}function bgBodyLoaded(){setWallpaper();cmi=new Array(ContextMenuItem(winIconConfig,winCaptionConfig,"bgConfigLink()"),ContextMenuItem("sep"),ContextMenuItem(winIconLogout,winCaptionLogout,"logout()"));ContextMenuAttach(D.body,cmi)}function bodyResized(){if(W.iconAdjustIcons){iconAdjustIcons()}if(W.winAdjustWindows){winAdjustWindows()}if(W.menuWinBarResized){menuWinBarResized()}if(W.sNotesResetPos){sNotesResetPos()}}function openResource(j,a,e,d,c){var f=j+"?resId="+a+"&rnd="+Math.random(),b=winPadding;if(!winFrames){D.location=f;return}if(c.separateWindow){W.open(f);return}if(winOpenLocation(f,"Win_"+(a),e)=="created"){var g=win("Win_"+(a));if(winClosedPosition["Win_"+(a)]){var i=Math.max(b.left,winClosedPosition["Win_"+(a)][0]);var h=Math.max(b.top,winClosedPosition["Win_"+(a)][1]);g.moveTo(i,h);g.resizeTo(Math.min(dd.getWndW()-i-b.right,winClosedPosition["Win_"+(a)][2]),Math.min(dd.getWndH()-h-b.bottom,winClosedPosition["Win_"+(a)][3]))}else{if(c.dWW&&c.dWH){defaultWindowWidth=Math.min(dd.getWndW()-b.left-b.right,c.dWW);defaultWindowHeight=Math.min(dd.getWndH()-b.top-b.bottom,c.dWH);g.moveTo((dd.getWndW()-defaultWindowWidth)/2,(dd.getWndH()-defaultWindowHeight)/2);g.resizeTo(defaultWindowWidth,defaultWindowHeight)}else{if(c.dWW&&c.dWH){g.resizeInnerTo(c.dWW,c.dWH);g.center()}else{if(dd.getWndW()>1024||dd.getWndH()>800){g.resizeTo(Math.min(1000,dd.getWndW()-b.left-b.right),Math.min(780,dd.getWndH()-b.top-b.bottom),true);g.center()}else{g.maximize({noAnimation:1})}}}}g.setIcon(d);if(c.remoteConfigFile){g.addControls(winConfigBt(a,c))}g.show()}}function setWallpaper(d,a){if(d){wallpaper=d}else{d=wallpaper}if(a){wallpaperPosition=a}else{a=wallpaperPosition}var e=dgi("wpDiv"),b=dgi("wpDiv2"),c=dgi("wpImg");if(d=="no"||!wallpaper){e.innerHTML="";e.style.backgroundColor="";if(d==="no"){D.body.style.backgroundImage="none"}return}if(d=="theme"){e.innerHTML="";e.style.background="";D.body.style.backgroundColor="";D.body.style.backgroundImage="";if(tWallpaper){d=tWallpaper;a=tWallpaperPosition}else{return}}if(a=="tiled"){e.style.background="url('"+d+"') repeat top left";e.innerHTML="";D.body.style.backgroundImage="none";if(d.substr(d.lastIndexOf("/")+1,1)=="-"){setBackgroundColor("#"+d.substr(d.lastIndexOf("/")+2,6))}else{setBackgroundColor(desktopColor)}}else{e.style.background=""}if(a=="stretched"){e.innerHTML='<img id="wpImg" alt="" style="width:100%;height:100%;visibility:hidden" oncontextmenu="return false" src="'+d+'">';D.body.style.backgroundImage="none";wpImageStretched.onload=wpStretch;wpImageStretched.src=d;if(d.substr(d.lastIndexOf("/")+1,1)=="-"){setBackgroundColor("#"+d.substr(d.lastIndexOf("/")+2,6))}else{setBackgroundColor(desktopColor)}}else{if(a=="centered"){e.innerHTML='<div id="wpDiv2" style="position:absolute;left:50%;top:50%"><img id="wpImg" alt="" style="position:relative;left:-50%;top:-50%" onContextMenu="return false" src="'+d+'" onload="wpCenter();fade(\'wpImg\',0,1)"></div>';if(d.substr(d.lastIndexOf("/")+1,1)=="-"){setBackgroundColor("#"+d.substr(d.lastIndexOf("/")+2,6))}else{setBackgroundColor(desktopColor)}D.body.style.backgroundImage="none"}}}function wpCenter(){if(wallpaperPosition!="centered"){return}var a=dgi("wpImg");a.style.left=-Math.floor(a.offsetWidth/2);a.style.top=-Math.floor(a.offsetHeight/2)}function wpStretch(){var c=W.wpImageStretched;var a=c.width,d=c.height,b=dgi("wpImg"),f=b.style,e=dgi("wpDiv");if(a/d>10||d/a>10){f.height=f.width="100%"}else{sr=e.offsetWidth/e.offsetHeight>a/d;f.width=(sr)?"100%":"auto";f.height=(sr)?"auto":"100%";f.marginTop=(sr)?((e.offsetHeight-b.offsetHeight)/2)+"px":0;f.marginLeft=(sr)?0:((e.offsetWidth-b.offsetWidth)/2)+"px";disconnect(W,"resize",wpStretch);connect(W,"resize",wpStretch)}if(f.visibility=="hidden"){fade(b)}}function setBackgroundColor(a){if(a==-1){return}desktopColor=a;D.body.style.backgroundColor=a}function iconAnimate(){if(!windowsAnimation||!W.iconsList){return}var d=function(f,e){if(!e.rand){e.rand=0.2*Math.random()}if(f!=1){f=Math.max(0,f-e.rand);f=1-Math.exp(-6*f)*Math.cos(16*f)}return{left:(f*e.eP.left+100*(f-1))+"px",top:(1*e.eP.top+100*(1-1))+"px"}};var c,a,b=[];for(c=0;c<iconsList.length;c++){a=iconsList[c];it=dgi("resIcon_"+a[0]);b.push({item:it,eP:{left:it.offsetLeft,top:it.offsetTop},"function":function(f,e){return d(f,e)}})}wl.anim({items:b,duration:1000})};